package com.yfbao.horizon.utils;

import java.util.HashMap;
import java.util.Map;

public class TrieNode {
    private Map<Character, TrieNode> children = new HashMap<>();
    private boolean isEndOfWord = false;

    public void addChild(char c) {
        children.put(c, new TrieNode());
    }

    public TrieNode getChild(char c) {
        return children.get(c);
    }

    public void setEndOfWord(boolean endOfWord) {
        isEndOfWord = endOfWord;
    }

    public boolean isEndOfWord() {
        return isEndOfWord;
    }

}

